package com.spzx.product.api;

import com.spzx.common.core.constant.SecurityConstants;
import com.spzx.common.core.constant.ServiceNameConstants;
import com.spzx.common.core.domain.R;
import com.spzx.product.api.domain.VO.CategoryVO;
import com.spzx.product.api.factory.RemoteCategoryFallbackFactory;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.List;

@FeignClient(contextId = "remoteCategoryService"
,value = ServiceNameConstants.PRODUCT_SERVICE
,fallbackFactory = RemoteCategoryFallbackFactory.class )
public interface RemoteCategoryService {
    @Operation(summary = "内部调用接口：获取首页分类集合")
    @GetMapping("/category/indexCategoryList")
    public R<List<CategoryVO>> getFirstCategoryList(@RequestHeader(SecurityConstants.FROM_SOURCE)String s);
    @Operation(summary = "内部调用:获取分类下拉树列表")
    @GetMapping("/category/tree")
    public R<List<CategoryVO>> getCategoryTree(@RequestHeader(SecurityConstants.FROM_SOURCE)String s);
}
